<template>
	<view class="content">
		<view class="rule">
			 <jyf-parser :html="html" ></jyf-parser>
			<!-- <view class="title">规则说明</view>
			<view class="list-item">
				1. 规则说明规则说明规则说明规则说明规则说明规则说明地地
			</view>
			<view class="list-item">
				1. 规则说明规则说明规则说明规则说明规则说明规则说明地地
			</view>
			<view class="list-item">
				1. 规则说明规则说明规则说明规则说明规则说明规则说明地地
			</view> -->
		</view>
		<view class="rule" style="margin-bottom: 0;">
			<view class="title">信息填写</view>
		</view>
		<view class="row">
			<view class="tit">
				<text>*</text>
				姓名：
			</view>
			<input class="input" type="text" v-model="name" placeholder="我们怎么称呼您！" placeholder-class="placeholder" />
		</view>
		<view class="row">
			<view class="tit">
				<text>*</text>
				联系电话：
			</view>
			<input class="input" type="tel" v-model="phone" placeholder="请输入您的联系电话" placeholder-class="placeholder" />
		</view>
		
		<view class="row">
			<view class="tit">
				<text>*</text>
				评估成果：
			</view>
			<view class="input">{{patentName}}</view>
			<!-- <input class="input" type="text" readonly="readonly" v-model="patentName" placeholder="金属液悬浮连续铸造近终型余热有助金属..." placeholder-class="placeholder" /> -->
		</view>
		<view class="row">
			<view class="tit">
				<text>*</text>
				所在位置：
			</view>
			<input class="input" type="text" v-model="address" placeholder="省市县及详细位置" placeholder-class="placeholder" />
		</view>
		<button class="add-btn" @click="confirm">提交</button>
	</view>
</template>

<script>
import jyfParser from "@/components/jyf-parser/jyf-parser";
export default {
	components: { },
	name: '',
	data() {
		return {
			html:'',
			address:'',
			id:'',
			name:'',
			patentId:'',
			phone:'',
			status:'',
			type:'',
			patentName:'',
			types:''
		};
	},
	mounted() {},
	onLoad(option) {
		console.log(option);
		this.patentId = option.patentId
		this.patentName = option.patentName
		this.type = option.type
		this.gettext(option.type)
		this.types = option.type -4
		console.log(this.types)
		if(option.type == 5){
			uni.setNavigationBarTitle({
				title:'成果价值评估需求'
			})
		}else if(option.type == 6){
			uni.setNavigationBarTitle({
				title:'寻求销售渠道合作'
			})
		}else if(option.type == 7){
			uni.setNavigationBarTitle({
				title:'寻求转化生产合作'
			})
		}else if(option.type == 8){
			uni.setNavigationBarTitle({
				title:'寻求法律维权服务'
			})
		}
	},
	
	methods: {
		//获取文本
		gettext(type){
			this.$http.get('/public/getAgreement', {
				type: type
			}).then(res => {
				if (res.code == 0) {
					this.html = res.data.content
					
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					});
				}
			});
		},
		//提交 
		confirm() {
			let params = {
				address: this.address,
				id: this.id,
				name: this.name,
				patentId: this.patentId,
				phone:this.phone,
				status: this.status,
				type: this.types
			};
			this.$http.post('/myPatent/patentNeedApply', params).then(res => {
				if (res.code == '0') {
					console.log(res.data);
					uni.showToast({
						icon:"none",
						title:res.data
					})
					setTimeout(()=>{
						uni.navigateTo({
							url:'/pages/status/wait?type='+this.type
						})
					},1500)
					
				}
			});
		}
	}
};
</script>

<style lang="scss">
page {
	padding-top: 16upx;
	// background-color: #fff;
}

.content {
	// background-color: #fff;
	padding-bottom: 72upx;
	.rule{
		display: flex;
		flex-direction: column;
		padding: 20upx 30upx;
		background-color: #fff;
		margin-bottom: 20upx;
		.title{
			
			font-size: 32upx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #22222A;
		}
		.list-item{
			margin-top: 30upx;
			font-size: 28upx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #666666;
			line-height: 36upx;
		}
	}
	.row {
		display: flex;
		align-items: center;
		position: relative;
		padding: 0 30upx;
		height: 110upx;
		line-height: 110upx;
		background: #fff;
		border-bottom: 1upx solid rgba(238, 238, 238, 1);
		.arrow {
			width: 14upx;
			height: 24upx;
		}
		.close {
			width: 32upx;
			height: 32upx;
		}
		.addTag {
			width: 44upx;
			height: 44upx;
		}
		.tit {
			flex-shrink: 0;
			width: 200upx;
			font-size: 30upx;
			> text {
				color: #ff1a1a;
				font-size: 40upx;
				line-height: 110upx;
			}
		}
		.code {
			width: 104upx;
			height: 50upx;
			background: rgba(255, 255, 255, 1);
			border: 1upx solid rgba(253, 88, 10, 1);
			border-radius: 8upx;
			font-size: 24upx;
			color: rgba(253, 88, 10, 1);
			text-align: center;
			line-height: 50upx;
		}
		.input {
			flex: 1;
			font-size: 30upx;
		}

		.icon-shouhuodizhi {
			font-size: 36upx;
		}
	}
}
.add-btn {
	width: 600upx;
	height: 88upx;
	background: rgba(255, 117, 23, 1);
	border-radius: 8upx;
	font-size: 34upx;
	color: #fff;
	text-align: center;
	line-height: 88upx;
	margin-top: 120upx;
}
</style>
